<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,initial-scale=1,user-scalable=yes"/>
	<style>
	body {
		font-family: Segoe UI;
		box-sizing: border-box;
	}
	img {
		width: 300px;
	}
	</style>
</head>
<body>

	<pre></pre>

	<script>
	let worker = new Worker('worker.js')
	let pre = document.querySelector('pre')

	function log(string) {
		pre.innerText += string + '\n'
	}

	log(`main script spawned worker`)
	let t1 = performance.now()
	worker.postMessage('../test/fixtures/IMG_20180725_163423.jpg')
	worker.onmessage = e => {
		let t2 = performance.now()
		log(`${(t2 - t1).toFixed(1)} ms`)
		log(`main script received exif from worker`)
		log('-------------------------------------------------------')
		log(JSON.stringify(e.data, null, 2))
	}

	</script>

</body>
</html>